<template>
  <div class="child">
    <h3>子组件</h3>
    <h4>A - B：{{ subAB }}</h4>
    <div style="display: flex; justify-content: space-between">
      <GrandChild1 />
      <GrandChild2 />
    </div>
  </div>
</template>

<script setup lang="ts" name="Child">
import { useCounterStore } from "@/stores/counterStore";
import { storeToRefs } from "pinia";
import GrandChild1 from "./GrandChild1.vue";
import GrandChild2 from "./GrandChild2.vue";

const counterStore = useCounterStore();
const { subAB } = storeToRefs(counterStore);
</script>

<style scoped>
.child {
  margin-top: 20px;
  background-color: skyblue;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 10px black;
}
</style>
